package com.xlh.support.quiz.constant;

/**
 * 随堂提问类型
 *
 * @author cheer
 */
public enum QuizTypeEnum {

    JUDGEMENT(1, "判断题"),
    SAQ(2, "问答题");

    private Integer code;

    private String message;

    public static QuizTypeEnum forCode(Integer code) {
        if (code == null) {
            return null;
        }

        for (QuizTypeEnum quizTypeEnum : QuizTypeEnum.values()) {
            if (quizTypeEnum.code.equals(code)) {
                return quizTypeEnum;
            }
        }
        return null;
    }

    QuizTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
